Skip to content

Port automation scripts from JavaScript to Go#3691

Open
Ankitsinghsisodya wants to merge 4 commits intoknative:mainfrom
Ankitsinghsisodya:fix/2815-port-js-scripts-to-go
Open

Port automation scripts from JavaScript to Go#3691
Ankitsinghsisodya wants to merge 4 commits intoknative:mainfrom
Ankitsinghsisodya:fix/2815-port-js-scripts-to-go

Conversation

@Ankitsinghsisodya
Copy link
Copy Markdown
Contributor

@Ankitsinghsisodya Ankitsinghsisodya commented May 10, 2026

Changes

  • Remove hack/update-ca-bundle.js, hack/update-quarkus-platform.js, and hack/update-springboot-platform.js, eliminating the Node.js runtime dependency from CI
  • Add Go programs under hack/cmd/ for each removed script: update-ca-bundle, update-quarkus-platform, update-springboot-platform
  • Add hack/cmd/shared package with a shared HTTP client and command runner used across the new programs
  • Update update-ca-bundle.yaml, update-quarkus-platform.yaml, and update-springboot-platform.yaml workflows to use the new Go programs via go run, delegate PR creation to peter-evans/create-pull-request@v7, and gate smoke tests and PR creation on actual file changes
  • Add update-quarkus-platform, update-springboot-platform, and update-ca-bundle Makefile targets for local invocation

/kind cleanup

Fixes #2815

Release Note


Docs


- Introduced new Makefile targets: `update-quarkus-platform`, `update-springboot-platform`, and `update-ca-bundle` to automate the process of updating respective platform versions in templates.
- Updated GitHub Actions workflows for `update-ca-bundle`, `update-quarkus-platform`, and `update-springboot-platform` to utilize Go scripts instead of Node.js for executing updates.
- Added new Go scripts for handling the update logic for CA bundle, Quarkus platform, and Spring Boot platform, including PR creation and version checks.
- Implemented shared GitHub client functionality for PR management and version retrieval.

This change enhances the automation of platform updates and streamlines the CI/CD process for dependency management.
…ment

- Updated Makefile targets to streamline the execution of platform updates for Quarkus, Spring Boot, and CA bundle.
- Replaced Node.js scripts with Go scripts for better performance and maintainability in GitHub Actions workflows.
- Enhanced the update logic for CA bundle, Quarkus platform, and Spring Boot platform, including automated PR creation and version checks.
- Removed outdated JavaScript files related to platform updates, consolidating functionality within Go.

These changes improve the automation process for dependency management and enhance the CI/CD workflow.
- Pass GITHUB_TOKEN to the Spring Boot update step so GitHub API calls
  are authenticated (unauthenticated rate limit is 60 req/hr, shared
  across all Actions runners, causing intermittent 403s on the 4-hour cron)
- Add a git-diff check after each Go tool + make generate step; skip
  smoke tests and the create-pull-request action when no files changed,
  restoring the early-exit behaviour the original JS scripts had
Copilot AI review requested due to automatic review settings May 10, 2026 12:58
@knative-prow knative-prow Bot added the kind/cleanup Cleanup label May 10, 2026
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 10, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Ankitsinghsisodya
Once this PR has been reviewed and has the lgtm label, please assign matejvasek for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow Bot requested review from dsimansk and jrangelramos May 10, 2026 12:58
@knative-prow knative-prow Bot added needs-ok-to-test 🤖 Needs an org member to approve testing size/XL 🤖 PR changes 500-999 lines, ignoring generated files. labels May 10, 2026
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 10, 2026

Hi @Ankitsinghsisodya. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ports the repository’s scheduled hack/ automation from Node.js scripts to Go commands, removing the Node runtime/dependency from CI while preserving the update workflows for embedded templates.

Changes:

  • Removed the three Node.js automation scripts under hack/ (CA bundle, Quarkus platform, Spring Boot platform).
  • Added equivalent Go commands under hack/cmd/ plus a small shared package for HTTP + command execution.
  • Updated the GitHub Actions workflows (and added Makefile targets) to invoke the new Go commands and create PRs via peter-evans/create-pull-request@v7, gated on actual file changes.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Makefile Adds local targets to run the new Go-based update commands.
hack/update-springboot-platform.js Removes the old Node.js Spring Boot platform updater.
hack/update-quarkus-platform.js Removes the old Node.js Quarkus platform updater.
hack/update-ca-bundle.js Removes the old Node.js CA bundle updater.
hack/cmd/update-springboot-platform/main.go Go implementation to update Spring Boot + compatible Spring Cloud versions in template POMs.
hack/cmd/update-quarkus-platform/main.go Go implementation to update Quarkus platform version in template POMs.
hack/cmd/update-ca-bundle/main.go Go implementation to run the CA bundle update Make target.
hack/cmd/shared/github.go Introduces shared HTTP client + command runner used by the new tools.
.github/workflows/update-springboot-platform.yaml Switches workflow from Node to Go, adds diff-gating, smoke tests, and PR creation via create-pull-request.
.github/workflows/update-quarkus-platform.yaml Same migration for Quarkus platform workflow.
.github/workflows/update-ca-bundle.yaml Same migration for CA bundle workflow, with diff-gated PR creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile Outdated
Comment thread Makefile Outdated
Comment thread Makefile Outdated
Comment thread .github/workflows/update-springboot-platform.yaml Outdated
Comment thread .github/workflows/update-quarkus-platform.yaml Outdated
Comment thread .github/workflows/update-ca-bundle.yaml Outdated
Comment thread hack/cmd/shared/shared.go
@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.82%. Comparing base (0209813) to head (4f9a839).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3691      +/-   ##
==========================================
- Coverage   56.90%   56.82%   -0.09%     
==========================================
  Files         181      181              
  Lines       20933    20933              
==========================================
- Hits        11912    11895      -17     
- Misses       7811     7832      +21     
+ Partials     1210     1206       -4     
Flag Coverage Δ
e2e 36.14% <ø> (-0.02%) ⬇️
e2e go 32.75% <ø> (ø)
e2e node 28.48% <ø> (ø)
e2e python 33.11% <ø> (ø)
e2e quarkus 28.62% <ø> (ø)
e2e rust 28.01% <ø> (-0.01%) ⬇️
e2e springboot 26.50% <ø> (ø)
e2e typescript 28.59% <ø> (-0.03%) ⬇️
e2e-config-ci ?
integration 17.43% <ø> (+<0.01%) ⬆️
unit macos-14 45.00% <ø> (+0.01%) ⬆️
unit macos-latest 45.00% <ø> (+0.01%) ⬆️
unit ubuntu-24.04-arm 45.17% <ø> (+<0.01%) ⬆️
unit ubuntu-latest 45.85% <ø> (+0.01%) ⬆️
unit windows-latest 44.98% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@matejvasek matejvasek requested a review from gauron99 May 10, 2026 16:30
@matejvasek
Copy link
Copy Markdown
Contributor

PTAL @gauron99

- Switch all `go run .../main.go` invocations to `go run ./pkg` in
  Makefile and the three CI workflows so additional files added to a
  command package are automatically included
- Rename hack/cmd/shared/github.go → shared.go; the file contains a
  generic HTTP client and command runner, not GitHub-specific helpers
@Ankitsinghsisodya
Copy link
Copy Markdown
Contributor Author

@matejvasek @gauron99 can you re-run the failed ci. I think it is flaky and not related to the changes I have done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Cleanup needs-ok-to-test 🤖 Needs an org member to approve testing size/XL 🤖 PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve our hack/ scripting!

3 participants